<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
		/*	var num1= prompt("请输入第一个数");
			var cao = prompt("请输入操作符","+");
			var num2 = prompt("请输入第二个数：");
			num1 = parseInt(num1);
			num2 = parseInt(num2);
			switch(cao){
				case "+":
					alert(num1+num2);
				break;
				case "-":
					alert(num1-num2);
				break;
				case "*":
					alert(num1*num2);
				break;
				case "/":
					if(num2!=0){
						alert(num1/num2);
					}else{
						alert("除数不能为0");
					}
				break;
				case "%":
					alert(num1%num2);
				break;
				default:
					alert("请输入+-*%之间的任意一个");
				break;
				
			}*/
			
			var num = prompt("请输入科目数量");
			num = parseInt(num);
			var sum = 0;
			for(var i = 0 ;i<num ;i++){
				var score = prompt("请输入成绩：");
				score = parseInt(score);
				sum+=score;
			}
			alert("和是："+sum);
			
		</script>
	</body>
</html>
